﻿/// <reference path="jquery.min.js" />
/// <reference path="rsseasy.min.js" />
/// <reference path="rsseasy.app.js" />
/// <reference path="webviewadapter.min.js" />

$(function () {
    var fabupage = $("#fabupage");
    fabupage.find(".right").click(function (ev) {
        ev.preventDefault();
        JsAdapter.Progress({ "style": true }).Submit();
        new Ajax("article/append").keyvalue("title", $("#articletitle").val()).keyvalue("matter", $("#articlematter").val()).keyvalue("myid", RssUser.Data.myid).keyvalue("ico", $("#ico").val()).post(function (data) {
            JsAdapter.Progress({ "action": "hide" }).Submit();
            JsAdapter.ToastShow("发送成功，管理员审核中").Submit();
            document.getElementById("articleform").reset();
        });
    });
    var photowrap = $("#btnselectphoto");
    photowrap.click(function () {
        masklayer.show();
        selpage.show();

        JsAdapter.onUpLoadFile = function (json) {
            photowrap.html('<img src="' + RssApp.UpHost + json["url"] + '" />');
            $("#ico").val(json["url"]);

            JsAdapter.Progress({ "action": "hide" }).Submit();
        }
    });

});